package com.lanyou.esb.cook.proxy.meta;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * 审核状态<br>
 * 描述： <br>
 * 0：未审核；1：已审核；2：驳回；3：其它
 * 
 * @author Davey.wu
 */
public enum AuditStatus {
	UNAUDITED("0"), AUDITED("1"), REJECT("2"), OTHER("3");

	// public static final String TypeCode = "10009";

	public final String ValueCode;

	private AuditStatus(String code) {
		this.ValueCode = code;
	}

	public static AuditStatus get(String valueCode)
			throws NoSuchObjectException {
		if (StringUtils.isBlank(valueCode)) {
			throw new NullPointerException();
		}
		for (AuditStatus type : AuditStatus.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
